// source --> //stonecrestmarble.com/wp-content/plugins/advanced-access-manager/media/js/aam-login.js?ver=5.2.7 /** * ====================================================================== * LICENSE: This file is subject to the terms and conditions defined in * * file 'license.txt', which is part of this source code package. * * ====================================================================== */ if (typeof jQuery !== 'undefined') { (function ($) { $('document').ready(function () { $('.login-input').bind('keyup', function(event) { if (event.which === 13) { $('.aam-login-submit').trigger('click'); } }); $('.aam-login-submit').each(function () { $(this).bind('click', function () { var button = $(this); var prefix = $(this).data('prefix'); var log = $.trim($('#' + prefix + 'log').val()); var pwd = $('#' + prefix + 'pwd').val(); if (log && pwd) { $('#' + prefix + 'error').css('display', 'none'); $.ajax(aamLocal.ajaxurl, { data: { log: log, pwd: pwd, action: 'aamlogin', redirect: $('#' + prefix + 'redirect').val(), rememberme: ($('#' + prefix + 'rememberme').prop('checked') ? 1 : 0) }, dataType: 'json', type: 'POST', beforeSend: function() { button.attr({ disabled: 'disabled', 'data-original-label': button.val() }).val('Wait...'); }, success: function(response) { if (response.status === "success") { if (response.redirect) { location.href = response.redirect; } } else { $('#' + prefix + 'error').html( response.reason ).css('display', 'block'); } }, error: function() { $('#' + prefix + 'error').html( 'ERROR: Unexpected error.' ).css('display', 'block'); }, complete: function() { button.attr({ disabled: null }).val(button.attr('data-original-label')); } }); } else { $('#' + prefix + 'error').html( 'ERROR: Username and password are required.' ).css('display', 'block'); } }); }); }); })(jQuery); } else { console.log( 'AAM requires jQuery library in order for login widget to work' ); }; // source --> https://stonecrestmarble.com/wp-content/plugins/divi_woo_layout_injector/includes/js/jquery.zoom.min.js?ver=5.2.7 /*! Zoom 1.7.20 license: MIT http://www.jacklmoore.com/zoom */ (function(o){var t={url:!1,callback:!1,target:!1,duration:120,on:"mouseover",touch:!0,onZoomIn:!1,onZoomOut:!1,magnify:1};o.zoom=function(t,n,e,i){var u,c,r,a,m,l,s,f=o(t),h=f.css("position"),d=o(n);return t.style.position=/(absolute|fixed)/.test(h)?h:"relative",t.style.overflow="hidden",e.style.width=e.style.height="",o(e).addClass("zoomImg").css({position:"absolute",top:0,left:0,opacity:0,width:e.width*i,height:e.height*i,border:"none",maxWidth:"none",maxHeight:"none"}).appendTo(t),{init:function(){c=f.outerWidth(),u=f.outerHeight(),n===t?(a=c,r=u):(a=d.outerWidth(),r=d.outerHeight()),m=(e.width-c)/a,l=(e.height-u)/r,s=d.offset()},move:function(o){var t=o.pageX-s.left,n=o.pageY-s.top;n=Math.max(Math.min(n,r),0),t=Math.max(Math.min(t,a),0),e.style.left=t*-m+"px",e.style.top=n*-l+"px"}}},o.fn.zoom=function(n){return this.each(function(){var e=o.extend({},t,n||{}),i=e.target&&o(e.target)[0]||this,u=this,c=o(u),r=document.createElement("img"),a=o(r),m="mousemove.zoom",l=!1,s=!1;if(!e.url){var f=u.querySelector("img");if(f&&(e.url=f.getAttribute("data-src")||f.currentSrc||f.src),!e.url)return}c.one("zoom.destroy",function(o,t){c.off(".zoom"),i.style.position=o,i.style.overflow=t,r.onload=null,a.remove()}.bind(this,i.style.position,i.style.overflow)),r.onload=function(){function t(t){f.init(),f.move(t),a.stop().fadeTo(o.support.opacity?e.duration:0,1,o.isFunction(e.onZoomIn)?e.onZoomIn.call(r):!1)}function n(){a.stop().fadeTo(e.duration,0,o.isFunction(e.onZoomOut)?e.onZoomOut.call(r):!1)}var f=o.zoom(i,u,r,e.magnify);"grab"===e.on?c.on("mousedown.zoom",function(e){1===e.which&&(o(document).one("mouseup.zoom",function(){n(),o(document).off(m,f.move)}),t(e),o(document).on(m,f.move),e.preventDefault())}):"click"===e.on?c.on("click.zoom",function(e){return l?void 0:(l=!0,t(e),o(document).on(m,f.move),o(document).one("click.zoom",function(){n(),l=!1,o(document).off(m,f.move)}),!1)}):"toggle"===e.on?c.on("click.zoom",function(o){l?n():t(o),l=!l}):"mouseover"===e.on&&(f.init(),c.on("mouseenter.zoom",t).on("mouseleave.zoom",n).on(m,f.move)),e.touch&&c.on("touchstart.zoom",function(o){o.preventDefault(),s?(s=!1,n()):(s=!0,t(o.originalEvent.touches[0]||o.originalEvent.changedTouches[0]))}).on("touchmove.zoom",function(o){o.preventDefault(),f.move(o.originalEvent.touches[0]||o.originalEvent.changedTouches[0])}).on("touchend.zoom",function(o){o.preventDefault(),s&&(s=!1,n())}),o.isFunction(e.callback)&&e.callback.call(r)},r.setAttribute("role","presentation"),r.src=e.url})},o.fn.zoom.defaults=t})(window.jQuery); // source --> https://stonecrestmarble.com/wp-content/plugins/divi_woo_layout_injector/includes/js/imagesloaded.pkgd.min.js?ver=5.2.7 /*! * imagesLoaded PACKAGED v4.1.3 * JavaScript is all like "You images are done yet or what?" * MIT License */ !function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return-1==n.indexOf(t)&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{},n=i[e]=i[e]||{};return n[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return-1!=n&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=0,o=i[n];t=t||[];for(var r=this._onceEvents&&this._onceEvents[e];o;){var s=r&&r[o];s&&(this.off(e,o),delete r[o]),o.apply(this,t),n+=s?0:1,o=i[n]}return this}},t.allOff=t.removeAllListeners=function(){delete this._events,delete this._onceEvents},e}),function(e,t){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return t(e,i)}):"object"==typeof module&&module.exports?module.exports=t(e,require("ev-emitter")):e.imagesLoaded=t(e,e.EvEmitter)}("undefined"!=typeof window?window:this,function(e,t){function i(e,t){for(var i in t)e[i]=t[i];return e}function n(e){var t=[];if(Array.isArray(e))t=e;else if("number"==typeof e.length)for(var i=0;i https://stonecrestmarble.com/wp-content/plugins/divi_woo_layout_injector/includes/js/script.js?ver=5.2.7 jQuery(document).ready(function () { if (jQuery('.single-product .sb_woo_product_image').length) { sb_woo_gen_hidden_images(); jQuery('.single-product .sb_woo_product_image').each(function () { var large_url = jQuery(this).children('img').attr('src'); if (!jQuery(this).hasClass('sb_woo_image_disable_zoom')) { jQuery(this).zoom({ callback: function () { if (!jQuery(this).hasClass('sb_woo_image_disable_lightbox')) { jQuery('.wli-clone').prepend(jQuery('')) jQuery(this).click(function() { jQuery('.wli-clone a').colorbox({rel: 'wli-clone', open: true, maxWidth: '95%', maxHeight: '95%', onClosed: function() { sb_woo_cbox_close(); }}); }); //jQuery(this).colorbox({ href: large_url }); } } }); } else { if (!jQuery(this).hasClass('sb_woo_image_disable_lightbox')) { jQuery('.wli-clone').prepend(jQuery('')) jQuery(this).click(function() { jQuery('.wli-clone a').colorbox({rel: 'wli-clone', open: true, maxWidth: '95%', maxHeight: '95%', onClosed: function() { sb_woo_cbox_close(); } }); }); //jQuery(this).colorbox({ href: large_url }); } } }); } if (jQuery('.single-product .cart.variations_form')) { //////////////////////////////////////////////// jQuery('.single-product .cart.variations_form .variations .value select').each(function (index, attr) { jQuery(this).change(function () { sb_woo_variation_image(); }); }); //////////////////////////////////////////////// } if (jQuery('.woocommerce-remove-coupon').length) { jQuery('.et_pb_woo_checkout_coupon').slideUp(); } //to handle removing items from the cart with a blank response. Note to edit this if no empty cart layout specified //jQuery(document.body).on('wc_fragments_refreshed', function () { //if (jQuery('body.woocommerce-cart').length && (!jQuery('.woocommerce-cart-form').length && !jQuery('.sb_et_woo_li_cart_empty').length)) { //console.log('Woo Injector Refreshing Cart'); //location.reload(); //refresh the page //} //}); //to recalculate the product count in cart jQuery(document.body).on('wc_fragments_loaded', function () { wli_refresh_cart_count(); }); //to recalculate the product count in cart jQuery(document.body).on('wc_fragments_refreshed', function () { wli_refresh_cart_count(); }); if (jQuery('body').hasClass('wli_injected')) { if (jQuery('.wpcf7').length > 0) { var wli_post_id, matches = document.body.className.match(/(^|\s)postid-(\d+)(\s|$)/); if (matches) { jQuery("input[name='_wpcf7_container_post']").val(matches[2]); jQuery(".wpcf7-submit").addClass('button'); jQuery(".wpcf7-form > p").addClass('form-row'); jQuery(".wpcf7-form > p .wpcf7-form-control-wrap input").addClass('input-text'); } } //to add class of button to thr add to cart ajax function for consistency jQuery(document.body).on('added_to_cart', function () { setTimeout(function () { jQuery('.added_to_cart').addClass('button'); }, 50); }); //to handle showing the coupon system in a lightbox jQuery(document.body).on("checkout_error", function () { if (jQuery('.woocommerce-NoticeGroup').length) { sb_woo_popup_notice(jQuery('.woocommerce-NoticeGroup').html()); setTimeout(function () { jQuery('.woocommerce-NoticeGroup').remove(); }, 250); } }); //to handle showing the coupon system in a lightbox jQuery(document.body).on("updated_wc_div", function () { if (jQuery('.woocommerce .woocommerce-error').length) { sb_woo_popup_notice(jQuery('.woocommerce .woocommerce-error')); jQuery('.entry-content .woocommerce .woocommerce-error').remove(); } if (jQuery('.woocommerce .woocommerce-message').length) { sb_woo_popup_notice(jQuery('.woocommerce .woocommerce-message').clone().wrap("
")); jQuery('.entry-content .woocommerce .woocommerce-message').remove(); } if (jQuery('.cart-empty').length > 0) { jQuery('.et_pb_woo_cart_totals').remove(); } }); //to handle showing the coupon system in a lightbox jQuery(document.body).on("applied_coupon", function () { if (jQuery('.woocommerce .woocommerce-error').length) { sb_woo_popup_notice(jQuery('.woocommerce .woocommerce-error')); jQuery('.entry-content .woocommerce .woocommerce-error').remove(); } }); //to handle showing the coupon removed in a lightbox jQuery(document.body).on("removed_coupon", function () { if (jQuery('.woocommerce .woocommerce-message').length) { sb_woo_popup_notice(jQuery('.woocommerce .woocommerce-message').clone().wrap("
")); jQuery('.entry-content .woocommerce .woocommerce-message').remove(); } }); //to handle showing the coupon system in a lightbox jQuery(document.body).on("update_checkout", function () { if (jQuery('.wli_wrapper_checkout-form-coupon .woocommerce-error').length) { sb_woo_popup_notice(jQuery('.wli_wrapper_checkout-form-coupon .woocommerce-error').clone().wrap("
")); jQuery('.et_pb_woo_checkout_coupon').slideDown(); } else if (jQuery('.wli_wrapper_checkout-form-coupon .woocommerce-message').length) { sb_woo_popup_notice(jQuery('.wli_wrapper_checkout-form-coupon .woocommerce-message').clone().wrap("
")); jQuery('.coupon-module').val(''); if (jQuery('.woocommerce-remove-coupon').length) { jQuery('.et_pb_woo_checkout_coupon').slideDown(); } else { jQuery('.et_pb_woo_checkout_coupon').slideUp(); } } else if (jQuery('.woocommerce .woocommerce-message').length) { sb_woo_popup_notice(jQuery('.woocommerce .woocommerce-message').clone().wrap("
")); setTimeout(function () { jQuery('.entry-content > .woocommerce > .woocommerce-message').remove(); }, 250); } }); } }); function wli_refresh_cart_count() { var wli_new_count = 0; if (jQuery('.sb_woo_mini_cart ul li').length) { jQuery('.sb_woo_mini_cart ul li').each(function () { var wli_quantity = jQuery(this).children('.quantity').text(); var wli_quantity_nums = wli_quantity.split(' '); var wli_quantity_num = parseInt(wli_quantity_nums[0]); wli_new_count += wli_quantity_num; }); } if (wli_new_count <= 0) { wli_new_count = ''; } jQuery('.sb_woo_prod_cart_container .et-cart-info span').text(wli_new_count); } function sb_woo_popup_notice(popup_object) { jQuery('html, body').scrollTop(0); jQuery.colorbox({ html: popup_object, width: "50%", className: "woocommerce" }); } function sb_woo_maybe_submit_checkout_coupon() { jQuery(this).keypress(function (e) { if (e.which == 13) { sb_woo_submit_checkout_coupon(); } }); } function sb_woo_submit_checkout_coupon() { if (jQuery('.coupon-module').length) { jQuery('.coupon-module').parent().removeClass('woocommerce-invalid').removeClass('woocommerce-validated'); var coupon = jQuery('.coupon-module').val(); if (coupon != '') { jQuery('#coupon_code').val(coupon); jQuery('.checkout_coupon').submit(); } else { jQuery('.coupon-module').parent().addClass('woocommerce-invalid').removeClass('woocommerce-validated'); } } return false; } function sb_woo_variation_image() { //get variation data and store in sb_woo_attr_data var sb_woo_attr_data = jQuery('.single-product .cart.variations_form').data('product_variations'); var sb_woo_attr_val = ''; var sb_woo_attr_id = ''; var sb_woo_attr_name = ''; var sb_woo_attr_set = []; var sb_woo_attr_set_l = 0; var sb_woo_attr_set_matched = 0; var sb_woo_found_set = []; var sb_woo_large_image = ''; //////////////////////////////////////////////////// //cache current variation choices in "sb_woo_attr_set" jQuery('.single-product .cart.variations_form .variations .value select').each(function (index2, attr2) { sb_woo_attr_val = jQuery(this).val(); sb_woo_attr_id = jQuery(this).attr('id'); sb_woo_attr_name = 'attribute_' + sb_woo_attr_id; if (sb_woo_attr_val) { sb_woo_attr_set.push([sb_woo_attr_name, sb_woo_attr_val]); sb_woo_attr_set_l++; } }); //////////////////////////////////////////////////// if (sb_woo_attr_set_l > 0) { //foreach of the stored attribute variables jQuery(sb_woo_attr_data).each(function (index3, attr3) { //loop variation prices var sb_woo_attrs = attr3.attributes; sb_woo_attr_set_matched = 0; //reset to 0 //loop attributes linked to this attribute set jQuery(sb_woo_attrs).each(function (index4, attr4) { jQuery(attr4).each(function (index4, attr4) { jQuery(sb_woo_attr_set).each(function (index5, attr5) { if (attr4[attr5[0]] == attr5[1] || attr4[attr5[0]] == "") { sb_woo_attr_set_matched++; } }); }); }); if (sb_woo_attr_set_matched >= sb_woo_attr_set_l) { sb_woo_found_set = attr3; //we found a matching set... store it! } }); if (typeof sb_woo_found_set.image !== 'undefined') { sb_woo_large_image = sb_woo_found_set.image.full_src; } else { sb_woo_large_image = jQuery('.sb_woo_product_thumb_col_num_1 a').data('large_image'); } if (jQuery('.sb_woo_product_image_container').length) { sb_woo_product_thumb_replace_by_url(sb_woo_large_image, jQuery('.sb_woo_product_image_container')); //we aren't selecting the same element here so just grab the image directly } } } function sb_woo_cbox_close() { //jQuery('a.wli-core').remove(); //jQuery('a.wli-added').remove(); } function sb_woo_gen_hidden_images() { //var $gallery = jQuery('
').appendTo('body'); var $gallery = jQuery('
').hide().appendTo('body'); var arr = jQuery('a.sb-woo-images'); var large_image = ''; jQuery.each(arr, function (i) { if (large_image = jQuery(this).data('large_image')) { jQuery('').appendTo($gallery); } }); //$gallery.find('a').colorbox({rel: 'wli-clone', open: true}); } function sb_woo_product_thumb_replace_by_url(large_image, image_object) { if (jQuery('.single-product .sb_woo_product_image img').attr('src') == large_image) { return; } var parent_object = image_object.closest('.sb_woo_product_image_container'); if (parent_object.length == 0) { var parent_object = jQuery('.sb_woo_product_image_container'); } if (parent_object.length) { parent_object.find('.sb_woo_product_image img').trigger('zoom.destroy'); // remove zoom parent_object.find('.sb_woo_product_image img.zoomImg').remove(); //remove old zoom image var image_height = parent_object.find('.sb_woo_product_image img').height(); parent_object.find('.sb_woo_product_image').css('height', image_height + 'px'); parent_object.find('.sb_woo_product_image img').fadeOut(400, function () { parent_object.find('.sb_woo_product_image img').attr('src', large_image); parent_object.find('.sb_woo_product_image').imagesLoaded(function () { var image_height = parent_object.find('.sb_woo_product_image img').height(); parent_object.find('.sb_woo_product_image').css('height', image_height + 'px'); parent_object.find('.sb_woo_product_image img').fadeIn(400, function () { if (!parent_object.find('.sb_woo_product_image').hasClass('sb_woo_image_disable_zoom')) { parent_object.find('.sb_woo_product_image').zoom({ callback: function () { if (!parent_object.find('.sb_woo_product_image').hasClass('sb_woo_image_disable_lightbox')) { jQuery.each(jQuery('.wli-clone a'), function() { if (jQuery(this).attr('href') == parent_object.find('.sb_woo_product_image img').attr('src')) { jQuery(this).remove(); } }); jQuery('.wli-clone').prepend(jQuery('')); //jQuery(this).colorbox({ href: parent_object.find('.sb_woo_product_image img').attr('src') }); parent_object.find('.sb_woo_product_image').click(function() { jQuery('.wli-clone a').colorbox({rel: 'wli-clone', open: true, maxWidth: '95%', maxHeight: '95%', onClosed: function() { sb_woo_cbox_close(); } }); }); } } }); } else { if (!parent_object.find('.sb_woo_product_image').hasClass('sb_woo_image_disable_lightbox')) { jQuery.each(jQuery('.wli-clone a'), function() { if (jQuery(this).attr('href') == parent_object.find('.sb_woo_product_image img').attr('src')) { jQuery(this).remove(); } }); jQuery('.wli-clone').prepend(jQuery('')) parent_object.find('.sb_woo_product_image').click(function() { jQuery('.wli-clone a').colorbox({rel: 'wli-clone', open: true, maxWidth: '95%', maxHeight: '95%', onClosed: function() { sb_woo_cbox_close(); }}); }); //jQuery('.sb_woo_product_image').colorbox({ href: parent_object.find('.sb_woo_product_image img').attr('src') }); } } }); }); }); } else { jQuery.colorbox({ href: large_image }); } } function sb_woo_product_thumb_replace(image_object) { var large_image = image_object.data('large_image'); sb_woo_product_thumb_replace_by_url(large_image, image_object); };